import React from "react";
import { IntlProvider } from "react-intl";
import RoutesConfig from "./route";

import enMessages from './locales/en.json';
import zhMessages from './locales/zh.json';

const messages = {
  'en': enMessages,
  'zh': zhMessages,
};

const language = localStorage.getItem("locale") || "zh";

const App = () => {
  return (
    <IntlProvider locale={language} messages={messages[language]}>
      <div id="container">
        <RoutesConfig></RoutesConfig>
      </div>
    </IntlProvider>
  );
};

export default App;
